package fr.iut2.sil1.trolledit.client;

public class Darkling extends Troll {
	private int balayage;
	private int siphonDesAmes;
	private String[] imgs = { "img/Darkling.jpg", "img/Darkling2.jpg", "img/Darkling3.jpg" };
	private String[] compSpe = { "Balayage", "Siphon des Ames" };
	
	//Constructeur par defaut.
	public Darkling(){
		super("Darkling");
	}
	//Constructeur avec arguments de la classe.
	public Darkling(int balayage, int siphonDesAmes){
		this.balayage = balayage;
		this.siphonDesAmes = siphonDesAmes;
			
	}
	//Constructeur avec super Constructeur.
	public Darkling(String nom, int attaque, int degats, int esquive, int regeneration, int pointDeVie, String image,int balayage, int siphonDesAmes){
		super(nom, attaque, degats, esquive, regeneration, pointDeVie, "Darkling", image);
		this.balayage = balayage;
		this.siphonDesAmes = siphonDesAmes;
	}
	//Constructeur depuis une chaine de caractères
	public Darkling(String troll) {
		this.fromString(troll);
	}
	public static String toString(Troll troll) {
		String chaine = Troll.toString(troll);
		chaine = chaine + "&balayage:" + troll.getCompSpe1();
		chaine = chaine + ":siphonDesAmes:" + troll.getCompSpe2();
		return chaine;
	}
	public void fromString(String chaine) {
		String tab[] = chaine.split("&");
		String tab2[] = tab[1].split(":");
		super.fromString(tab[0]);
		this.setBalayage(Integer.parseInt(tab2[1]));
		this.setSiphonDesAmes(Integer.parseInt(tab2[3]));
	}
	public int getBalayage() {
		return balayage;
	}
	public int getCompSpe1(){
		return balayage;
	}
	public void setBalayage(int balayage) {
		this.balayage = balayage;
	}
	public int getSiphonDesAmes() {
		return siphonDesAmes;
	}
	public int getCompSpe2(){
		return siphonDesAmes;
	}
	public void setSiphonDesAmes(int siphonDesAmes) {
		this.siphonDesAmes = siphonDesAmes;
	}
	public String[] getImgs() {
		return imgs;
	}
	public void setImgs(String[] imgs) {
		this.imgs = imgs;
	}
	public String[] getCompSpe() {
		return compSpe;
	}
	public void setCompSpe(String[] compSpe) {
		this.compSpe = compSpe;
	}

}
